<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/yemian',function (){
   return 'pages/home/home';
});


Route::post("/login",'LoginController@login');
//行业
Route::get('/industry','IndustryController@index');
//渠道来源
Route::get('/source','SourceController@index');
//项目
Route::get('/project','ProjectController@index');
//需求面积
Route::get('/area','AreaController@index');
//顾客需求
Route::get('/demand','CustomerDemandController@index');
//上传图片
Route::post('/upload','UploadController@index');
//接收百度表单请求
Route::post('/baidu/form','CoustomerController@baiduForm')->name('baiduFrom');
Route::any('/toutiao/form','CoustomerController@toutiaoForm')->name('toutiaoFrom');
//接收腾讯表单请求
Route::post('/tengxun/form','CoustomerController@tengxunForm')->name('tengxunFrom');
//增加客户
Route::middleware('auth:api')->post("/coustomer/create",'CoustomerController@create');




//客户列表
Route::middleware('auth:api')->group(function(){
    Route::get('/user', 'UserController@index');
    //用户所拥有的的权限
    Route::get('/permission','PermissionController@index');
    Route::get('/coustomer','CoustomerController@index');
    //公海客户
    Route::get('/seaCoustomer','CoustomerController@seaCoustomer');
    Route::any('/users/unionid','UserController@unionid');
    //解密
    Route::post('/decryptData','UserController@decryptData');
    //退出
    Route::post('/logout','LoginController@logout');
    //刷新token
    Route::post('/refresh/token','LoginController@refresh');
    Route::post('/follow/create','FollowController@create');
    Route::get('/coustomer/detail','CoustomerController@detail');
    //首页
    Route::get('/record','UserController@record');

    Route::get('/customer/list','CoustomerController@list');                                                //分配的客户列表
    Route::post('/customer/allot','CoustomerController@allot');
    Route::post('/customer/updateStatus','CoustomerController@updateStatus');
    //绑定手机号
    Route::post('/bind/mobile','UserController@bindMobile');
    //业务员信息
    Route::get('/user','UserController@index');
    Route::post('/user/form/create','UserController@formCreate');
    //业务员列表
    Route::get('/user/list','UserController@list');
    //业务员列表
    Route::get('/user/list1','UserController@list1');
    //客户修改信息
    Route::post('/customer/update','CoustomerController@update');
    //领取客户
    Route::post('/customer/receive','CoustomerController@receive');
    //获取区域列表
    Route::get('/customer/area','CoustomerController@area');
    //面积
    Route::get('/customer/mianji','CoustomerController@mianji');
    //V2 版本
    Route::prefix('v2')->group(function(){
        //项目
        Route::get('/project','ProjectController@indexV2');
        //写跟进
        Route::post('/follow/create','FollowController@createV2');
        //获取跟进状态
        Route::get('/follow/status','FollowController@statusV2');
        //首页2
        Route::get('/record1','UserController@recordV2');
        //项目经理首页
        Route::get('/record3','UserController@record3');
        //顾客类型接口
       Route::get('/customerSign','CustomerSignController@index');
        //查询消费
       Route::get('/xiaofei','XiaofeiController@xiaofei');
        //提交消费
        Route::post('/xiaofei','XiaofeiController@xiaofeiSubmit');

        //统计报表
       Route::get('/baobiao','BaobiaoController@index');
    });
});

